package com.doyens.controller;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.api.R;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.doyens.domain.Pcd;
import com.doyens.domain.Result;

import com.doyens.domain.TeacherDto;
import com.doyens.service.PcdService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/pcd")
public class  PcdController {
    @Autowired
    private PcdService pcdService;
//    public Result
    @GetMapping("/list")
   public Result list(){
       List<Pcd> list = pcdService.list();
       return new Result("查询所有成功",list,20000);
   }
   @GetMapping("/shengid/{id}")
   public Result getBYId(int id){
     return new Result("查询一个成功",pcdService.getById(id),20000) ;
   }
}
